//登录
export function longin(data) {
  return axios.post("/user/login", data);
}
import axios from "./index";
//添加地址
export function address(data) {
  return axios.post("/address/add", data);
}
//获取地址列表
export function getress(userid) {
  return axios.get(`/address/list?userid=${userid}`);
}
//修改地址
export function setupdate(data){
  return axios.post("/address/update",data)
}
//删除
export function setdelete(data){
  return axios.post("/address/delete",data)
}
//获取购物车数据
export function getgoodslist(data) {
  return axios.post("/cart/list", data);
}
//获取推荐列表
export function gettjlist() {
  return axios.get("/pro/recommendlist");
}
//获取产品详情
export function getdetail(data) {
  return axios.get(`/pro/detail/${data}`,{
    params:{
        proid:data,
    }
  });
}
//添加购物车
export function setaddcar(data){
    return axios.post("/cart/add",data)
}
//删除购物车单条
export function removecar(data){
  return axios.post("/cart/remove",data)
}
//更新购物车数量

export function updatenum(data){
    return axios.post("/cart/updatenum",data)
}
//更改单条购物车选中状态
export function selectone(data){
    return axios.post("/cart/selectone",data)
}
//更改全部购物车选中状态
export function selectall(data){
    return axios.post("/cart/selectall",data)
}
export function removecarall(data){
  return axios.post("/cart/removeall",data)
}
//获取热门商品
export function gethotword(){
    return axios.get("/pro/hotword")
}
//搜索列表
export function getsearch(keyword,count,limitNum,){
    return axios.get("/pro/search",{
      params:{
        keyword,
        count,
        limitNum,
      }
    })
}
//搜索详情
export function getseldel(count,keyword){
  return axios.get(`/pro/search?count=${count}&keyword=${keyword}`)
}